In computer graphics, the operation of clearing a large area of frame buffer memory is very expensive in terms of both time and processing resources. For example, in a system having 1280×1024 resolution, clearing the frame buffer requires accessing more than one million pixels. Indeed, clearing such a large area of memory can require more time than it takes to draw a frame of an image after the clear has been completed. Designers have attempted to address this problem either by speeding up the process of clearing or by avoiding the process altogether.
Special-Purpose Memory Devices. Frame buffers have been implemented using special-purpose memory devices that have a hardware clear feature. On one hand, the operation of clearing frame buffer memory in such embodiments is accelerated. On the other hand, the special-purpose memory devices used to implement the frame buffer add significantly to the cost of the implementation.
Fast Clear Techniques. As an alternative to using expensive memory devices, it is possible to employ “fast clear” techniques to avoid writing data to a large number of pixel locations each time a clear command is issued by an application.
One such fast clear technique is taught in U.S. Pat. No. 5,841,447, issued to Michael D. Drews and assigned to Evans & Sutherland Computer Corporation (hereinafter “Drews”). Drews teaches allocating an additional field in frame buffer memory for each pixel and storing a version number in the additional field. An alternate pixel value (a clear value) and a current version number are maintained in a pixel processor. During frame buffer reads executed by the pixel processor, the version number corresponding to a pixel is read from the frame buffer first. If the version number read from the frame buffer is not equal to the current version number stored in the pixel processor, then the alternate pixel value stored in the pixel processor is substituted for the pixel value that would have been read from the frame buffer. On the other hand, if the version numbers are equal, then the pixel value is read from the frame buffer and used. According to this technique, multiple pixels in the frame buffer can be made to appear to have been modified simply by changing the current version number stored in the pixel processor. Thus, the frequency with which “real” clearing operations must be performed can be reduced.
Another fast clear technique is taught in U.S. patent application Ser. No. 09/283,336, filed by Jon Ashburn and Bryan Prouty on Mar. 31, 1999, titled “Improved Technique for Reducing the Frequency of Frame Buffer Clearing” (hereinafter “Ashburn”). Ashburn is hereby incorporated by reference in its entirety. Ashburn teaches apparatus and methods for operating in a fast clear mode without allocating additional fields per pixel beyond those already existing in a standard frame buffer memory. In addition, Ashburn teaches how the fast clear mode may be used in a windowed environment. The Ashburn fast clear mode may be used, for example, with inexpensive SDRAM frame buffer memory devices.
Stale Information and Ghost Images. One aspect of operating according to the fast clear techniques of the prior art is that the contents of the frame buffer memory do not necessarily reflect what is actually being displayed on the monitor of the computer graphics system. This is because, for a pixel whose version number or frame count does not match the current version number or frame count, the pixel contents read from the frame buffer memory are replaced with a predetermined value before displaying the pixel on the monitor. (Hereinafter, the term “stale information” will be used to describe data stored in a frame buffer memory at a pixel location whose version or frame number does not match the current version number or frame count.) As long as the graphics system remains in a fast clear mode, stale information in the frame buffer does not cause problems. But if the mode of the graphics system changes from a fast clear mode to a non fast clear mode, “ghost images” will suddenly appear as a result of stale information being displayed on the monitor.
For this reason, it was heretofore believed impractical to switch from a fast clear mode to a non fast clear mode during the life of a display region such as a window. Instead, a decision was typically made before creating a new window whether the window would employ fast clear mode or not, and the mode of operation once chosen would not be changed during the life of the window. But the necessity of having a static clear mode during the life of a window is quite limiting: For fast clear windows, operations cannot be performed if they would require the frame buffer contents to match the image being displayed. And for non fast clear windows, the important performance enhancements provided by fast clear techniques are not realized.
In addition, it is common for subregions to be created within an existing display region and then later discontinued. For example, one or more subwindows, scissor regions or viewports are sometimes created within an existing window. The prior art does not teach how to apply fast clear techniques when subregions are created within an existing display region.
It is therefore an object of the invention to provide fast clear techniques that may be applied when a subregion is created within an existing display region.